package zigzag.designpattern.mediator;

import java.awt.event.*;
import javax.swing.*;

public class MediatorClient extends JFrame implements ActionListener {
    Mediator med = new Mediator();
    MediatorClient() {
       JPanel p = new JPanel();
       p.add(new BtnCalculate(this,med));
       p.add(new BtnHalt(this,med));
       p.add(new BtnStop(this, med));
       getContentPane().add(new LblDisplay(med), "North");
       getContentPane().add(p, "South");
       setSize(400,200);
       setVisible(true);
    
    }
    public void actionPerformed(ActionEvent ae) {
        Command comd = (Command)ae.getSource();
        comd.execute();
    }
	public static void main(String[] args) {
	    new MediatorClient();
    }
}